<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="docstyle.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Jvm_bytecode.html">
<link rel="next" href="Jvm_jar.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Jvm_bytecode" rel="Chapter" href="Jvm_bytecode.html">
<link title="Jvm_io" rel="Chapter" href="Jvm_io.html">
<link title="Jvm_jar" rel="Chapter" href="Jvm_jar.html">
<link title="Jvm_type" rel="Chapter" href="Jvm_type.html"><title>HaXeJvm Documentation : Jvm_io</title>
</head>
<body>
<div class="navbar"><a href="Jvm_bytecode.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Jvm_jar.html">Next</a>
</div>
<center><h1>Module <a href="type_Jvm_io.html">Jvm_io</a> (<a href="code_Jvm_io.html">.ml</a>)</h1></center>
<br>
<pre><span class="keyword">module</span> Jvm_io: <code class="code"><span class="keyword">sig</span></code> <a href="Jvm_io.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>This module provides functions to create "binary" buffers of JVM class files represented in 'jvm_bytecode.ml'.
<p>

 Those buffers can either be sent along to 'jvm_jar.ml' to bundle them together or back to this module
 to save them to disk.
 Note : it is considered a wanted design choice that this modules depends heavily on 'jvm_bytecode.ml'. They are
 essentially only seperated for maintanace reasons. Mentally they should be thought of as one, whereas 'jvm_bytecode.ml' deals with the more
 abstract ocaml representation of the class file format and 'jvm_classfile.ml' deals with the actual file IO.<br>
<b>Author(s):</b> Oliver Jan Krylow 2010<br>
<hr width="100%">
<br><code><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">U1</span> <span class="keyword">of</span> <code class="type">int</code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >8bit unsigned big endian byte  -&gt; jvm class file opcode size</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">U2</span> <span class="keyword">of</span> <code class="type">int</code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >16bit unsigned big endian</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">S2</span> <span class="keyword">of</span> <code class="type">int</code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >'' signed ''</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">U4</span> <span class="keyword">of</span> <code class="type">int64</code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >32bit unsigned big endian</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">S4</span> <span class="keyword">of</span> <code class="type">int32</code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >'' signed ''</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>

<div class="info">
jvm bytecode types -&gt; types for the jvm class file format Note: the     
 signed byte types are as far as I can see only used for switch opcodes, 
 but even there not really necessary, I leave them nonetheless for       
 potential future use or backward compatability, in case someone         
 implements it ^^<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPEstream"></a><code class="type"></code>stream = <code class="type"><a href="Jvm_io.html#TYPEt">t</a> list</code> </pre>

<pre><span class="keyword">exception</span> <a name="EXCEPTIONByteCodeOverflow"></a>ByteCodeOverflow <span class="keyword">of</span> <code class="type">string</code></pre>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONUnimplemented"></a>Unimplemented</pre>
<pre><span class="keyword">val</span> <a name="VALflatmap"></a><a href="code_VALJvm_io.flatmap.html">flatmap</a> : <code class="type">('a -> 'b list) -> 'a list -> 'b list</code></pre><div class="info">
little helper function to make code cleaner.<br>
</div>
<div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
f</td>
<td align="center" valign="top">:</td>
<td><code class="type">'a -> 'b list</code><br>

</tr>
<tr>
<td align="center" valign="top" width="15%" class="code">
l</td>
<td align="center" valign="top">:</td>
<td><code class="type">'a list</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALasU1"></a><a href="code_VALJvm_io.asU1.html">asU1</a> : <code class="type">int -> <a href="Jvm_io.html#TYPEt">t</a></code></pre><div class="info">
</div>
<div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
i</td>
<td align="center" valign="top">:</td>
<td><code class="type">int</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALasU2"></a><a href="code_VALJvm_io.asU2.html">asU2</a> : <code class="type">int -> <a href="Jvm_io.html#TYPEt">t</a></code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
i</td>
<td align="center" valign="top">:</td>
<td><code class="type">int</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALasU4"></a><a href="code_VALJvm_io.asU4.html">asU4</a> : <code class="type">int64 -> <a href="Jvm_io.html#TYPEt">t</a></code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
i</td>
<td align="center" valign="top">:</td>
<td><code class="type">int64</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALbytesplit"></a><a href="code_VALJvm_io.bytesplit.html">bytesplit</a> : <code class="type">int -> int -> <a href="Jvm_io.html#TYPEt">t</a></code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
i</td>
<td align="center" valign="top">:</td>
<td><code class="type">int</code><br>

</tr>
<tr>
<td align="center" valign="top" width="15%" class="code">
n</td>
<td align="center" valign="top">:</td>
<td><code class="type">int</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALbytesplit32"></a><a href="code_VALJvm_io.bytesplit32.html">bytesplit32</a> : <code class="type">int32 -> int -> <a href="Jvm_io.html#TYPEt">t</a></code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
i</td>
<td align="center" valign="top">:</td>
<td><code class="type">int32</code><br>

</tr>
<tr>
<td align="center" valign="top" width="15%" class="code">
n</td>
<td align="center" valign="top">:</td>
<td><code class="type">int</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALasUTF8mod"></a><a href="code_VALJvm_io.asUTF8mod.html">asUTF8mod</a> : <code class="type">string -> <a href="Jvm_io.html#TYPEt">t</a> list</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
str</td>
<td align="center" valign="top">:</td>
<td><code class="type">string</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALmerge_flags"></a><a href="code_VALJvm_io.merge_flags.html">merge_flags</a> : <code class="type"><a href="Jvm_bytecode.html#TYPEaccess_flag">Jvm_bytecode.access_flag</a> list -> <a href="Jvm_io.html#TYPEt">t</a></code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
flags_list</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEaccess_flag">Jvm_bytecode.access_flag</a> list</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALflag_to_int"></a><a href="code_VALJvm_io.flag_to_int.html">flag_to_int</a> : <code class="type"><a href="Jvm_bytecode.html#TYPEaccess_flag">Jvm_bytecode.access_flag</a> -> int</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
??</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEaccess_flag">Jvm_bytecode.access_flag</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALcount_bytes"></a><a href="code_VALJvm_io.count_bytes.html">count_bytes</a> : <code class="type"><a href="Jvm_io.html#TYPEt">t</a> list -> int</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
bytes_list</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_io.html#TYPEt">t</a> list</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONIllegalWideArg"></a>IllegalWideArg <span class="keyword">of</span> <code class="type"><a href="Jvm_bytecode.html#TYPEopcode">Jvm_bytecode.opcode</a></code></pre>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONIllegalChop"></a>IllegalChop <span class="keyword">of</span> <code class="type">int * int</code></pre>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONIllegalAppend"></a>IllegalAppend <span class="keyword">of</span> <code class="type">int * int * <a href="Jvm_bytecode.html#TYPEverification_type_info">Jvm_bytecode.verification_type_info</a> list</code></pre>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONDeprecatedOpcode"></a>DeprecatedOpcode <span class="keyword">of</span> <code class="type"><a href="Jvm_bytecode.html#TYPEopcode">Jvm_bytecode.opcode</a></code></pre>
<pre><span class="keyword">val</span> <a name="VALstreamify"></a><a href="code_VALJvm_io.streamify.html">streamify</a> : <code class="type"><a href="Jvm_bytecode.html#TYPEt">Jvm_bytecode.t</a> -> <a href="Jvm_io.html#TYPEt">t</a> list</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
jclass</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEt">Jvm_bytecode.t</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALstreamify_verification"></a><a href="code_VALJvm_io.streamify_verification.html">streamify_verification</a> : <code class="type"><a href="Jvm_bytecode.html#TYPEverification_type_info">Jvm_bytecode.verification_type_info</a> -> <a href="Jvm_io.html#TYPEt">t</a> list</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
??</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEverification_type_info">Jvm_bytecode.verification_type_info</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALstreamify_entry"></a><a href="code_VALJvm_io.streamify_entry.html">streamify_entry</a> : <code class="type"><a href="Jvm_bytecode.html#TYPEstackmap_frame">Jvm_bytecode.stackmap_frame</a> -> <a href="Jvm_io.html#TYPEt">t</a> list</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
??</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEstackmap_frame">Jvm_bytecode.stackmap_frame</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALstreamify_attrs"></a><a href="code_VALJvm_io.streamify_attrs.html">streamify_attrs</a> : <code class="type"><a href="Jvm_bytecode.html#TYPEattribute_info">Jvm_bytecode.attribute_info</a> -> <a href="Jvm_io.html#TYPEt">t</a> list</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
??</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEattribute_info">Jvm_bytecode.attribute_info</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALstreamify_opcode"></a><a href="code_VALJvm_io.streamify_opcode.html">streamify_opcode</a> : <code class="type"><a href="Jvm_bytecode.html#TYPEopcode">Jvm_bytecode.opcode</a> -> <a href="Jvm_io.html#TYPEt">t</a> list</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
??</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEopcode">Jvm_bytecode.opcode</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALbinarize"></a><a href="code_VALJvm_io.binarize.html">binarize</a> : <code class="type">Pervasives.out_channel -> <a href="Jvm_io.html#TYPEt">t</a> -> unit</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
oc</td>
<td align="center" valign="top">:</td>
<td><code class="type">Pervasives.out_channel</code><br>

</tr>
<tr>
<td align="center" valign="top" width="15%" class="code">
byte_type</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_io.html#TYPEt">t</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALclassify"></a><a href="code_VALJvm_io.classify.html">classify</a> : <code class="type">'a -> 'b</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
ic</td>
<td align="center" valign="top">:</td>
<td><code class="type">'a</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONIllegalDebinarize"></a>IllegalDebinarize <span class="keyword">of</span> <code class="type">string</code></pre>
<pre><span class="keyword">val</span> <a name="VALdebinarize"></a><a href="code_VALJvm_io.debinarize.html">debinarize</a> : <code class="type">Pervasives.in_channel -> string -> <a href="Jvm_io.html#TYPEt">t</a></code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
ic</td>
<td align="center" valign="top">:</td>
<td><code class="type">Pervasives.in_channel</code><br>

</tr>
<tr>
<td align="center" valign="top" width="15%" class="code">
byte_id</td>
<td align="center" valign="top">:</td>
<td><code class="type">string</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALwrite_bytecode"></a><a href="code_VALJvm_io.write_bytecode.html">write_bytecode</a> : <code class="type">string -> <a href="Jvm_bytecode.html#TYPEt">Jvm_bytecode.t</a> -> unit</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
fileName</td>
<td align="center" valign="top">:</td>
<td><code class="type">string</code><br>

</tr>
<tr>
<td align="center" valign="top" width="15%" class="code">
classfile</td>
<td align="center" valign="top">:</td>
<td><code class="type"><a href="Jvm_bytecode.html#TYPEt">Jvm_bytecode.t</a></code><br>

</tr>
</table>
</td>
</tr>
</table></div>
<pre><span class="keyword">val</span> <a name="VALread_bytecode"></a><a href="code_VALJvm_io.read_bytecode.html">read_bytecode</a> : <code class="type">string -> unit</code></pre><div class="param_info"><table border="0" cellpadding="3" width="100%">
<tr>
<td align="left" valign="top" width="1%"><b>Parameters: </b></td>
<td>
<table class="paramstable">
<tr>
<td align="center" valign="top" width="15%" class="code">
fileName</td>
<td align="center" valign="top">:</td>
<td><code class="type">string</code><br>

</tr>
</table>
</td>
</tr>
</table></div>
</body></html>